(function() {
    'use strict';

    angular.module('BlurAdmin.theme')
        .factory('textAngular', textAngular);

    function textAngular($provide) {
        $provide.decorator('taOptions', ['taRegisterTool', '$delegate', function(taRegisterTool, taOptions) {
            // $delegate is the taOptions we are decorating
            // register the tool with textAngular
            taRegisterTool('colourRed', {
                iconclass: "fa fa-square red",
                action: function() {
                    // alert(123);
                    this.$editor().wrapSelection('forecolor', 'red');
                }
            });
            // add the button to the default toolbar definition
            taOptions.toolbar[1].push('colourRed');
            return taOptions;
        }]);
    }
})();